define([], function() {
    return {
        set: function(key, value, hours) {

            if (typeof day === 'number') {
                let date = new Date();
                date.setDate(date.getHours() + hours);
                document.cookie = `${key}=${vlaue};expires=${date};path=/`;

            } else {
                document.cookie = `${key}=${value};path=/`;
            }



        },
        get: function(key) {
            if (document.cookie) {
                let getdata = document.cookie;
                // let getdata1 = getdata1.split('; ');
                // console.log(getdata1);
                let cookies = getdata.split('; ');
                for (var i = 0; i < cookies.length; i++) {
                    let cookey = cookies[i].split('=')[0];
                    if (key === cookey) {
                        return cookies[i].split('=')[1];
                    }


                }
                return '';

            }
        },
        remove: function(key) {
            this.set(key, '', -1);

        }

    }
});